/**
 *  JFTSTool - Java Full Text Search tool.
 *  Copyright (C) <2009>  <grupo JFTS>
 *  This program is free software: you can redistribute it and/or modify
 *	it under the terms of the GNU General Public License as published by
 *	the Free Software Foundation, either version 3 of the License, or
 *	(at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *  
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.jftstool.indexer.document;

import java.util.HashMap;
import java.util.Map;

/**
 * This class represents a document extracted from a DB.
 * @author grupo JFTS
 */
public class DBDocument {
	private String documentField = null;
	private byte[] document = null;
	private Map<String, DBField> fields = null;
	
	public DBDocument(){
		document = null;
		fields = new HashMap<String, DBField>();
	}
	
	public DBDocument(String documentField, byte[] document, Map<String, DBField> fields){
		this.documentField = documentField;
		this.document = document;
		this.fields = fields;
	}
	
	public String getDocumentField(){
		return documentField;
	}
	
	public void setDocumentField(String documentField){
		this.documentField = documentField;
	}	
	
	public byte[] getDocument(){
		return document;
	}
	
	public void setDocument(byte[] document){
		this.document = document;
	}
	
	public Map<String, DBField> getFields(){
		return fields;
	}
	
	public void setFields(Map<String, DBField> fields){
		this.fields = fields;
	}
	
	public void setField(String key, DBField value){
		fields.put(key, value);
	}
	
	public DBField getField(String key){
		return fields.get(key);
	}	
}